home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / examples / exam12 / main.c < prev    next >
C/C++ Source or Header  |  1995-09-27  |  1KB  |  79 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24.  
  25. #include "generics.h"
  26.  
  27.  
  28. main(int argc, char *argv[])
  29. {
  30.     object    myObj;
  31.     char    *p;
  32.  
  33.     InitDynace(&argc);
  34.  
  35.     myObj = gNew(Class1);
  36.  
  37.     /*  Call the SetName method via the gSetName generic.  Notice that
  38.         the instance being effected is the first argument to the generic.
  39.         This is always the case.  */
  40.         
  41.     gSetName(myObj, "Tom Jones");
  42.  
  43.     /*  Get a pointer to the name associated with myObj  */
  44.     p = gGetName(myObj);
  45.     
  46.     /*  Display it.  */
  47.     printf("The name is %s\n", p);
  48.  
  49.  
  50.     gDispose(myObj);
  51.  
  52.     return 0;
  53. }
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. /*
  62.  *
  63.  *    This source code is CONFIDENTIAL and
  64.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  65.  *    distribution, adaptation or use    may
  66.  *    be subject to civil and    criminal penalties.
  67.  *
  68.  *    Copyright (c) 1993 Algorithms Corporation
  69.  *    3020 Liberty Hills Drive
  70.  *    Franklin, TN  37064
  71.  *
  72.  *    ALL RIGHTS RESERVED.
  73.  *
  74.  *
  75.  *
  76.  */
  77.  
  78.  
  79.